package iosr11.example;

import iosr11.Service.ServiceLocator;
import iosr11.data.Attendence;
import iosr11.data.Entity;
import iosr11.data.Event;
import iosr11.data.EventSeries;
import iosr11.data.Group;
import iosr11.data.Mark;
import iosr11.data.ProjectGroup;
import iosr11.data.ProjectSubject;
import iosr11.data.Student;
import iosr11.data.Teacher;

import org.springframework.beans.factory.BeanFactory;
import org.springframework.context.support.ClassPathXmlApplicationContext;



public class ServiceMain {

	/**
	 * @param args
	 */
	private static BeanFactory beanFactory;
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		beanFactory = new ClassPathXmlApplicationContext("service.xml");
		Object obj = beanFactory.getBean(Entity.class.getName());
		if (obj==null) System.out.println("blad");
		else System.out.println("powstal serwis");
		
		ServiceLocator locator = (ServiceLocator) obj;
		
		locator.getService(Attendence.class);
	/*	locator.getService(EventSeries.class);
		locator.getService(Event.class);
		locator.getService(Group.class);
		locator.getService(Mark.class);
		locator.getService(ProjectGroup.class);
		locator.getService(ProjectSubject.class);
		locator.getService(Student.class);
		locator.getService(Teacher.class);*/
		
	}

}
